rem Usage MDCopyBin.bat <FileName> <InputDir> <OutputDir> <SolutionDir>
rem Paths are without trailing \


set MDRoot=G:\programmer\valve\steam\SteamApps\SourceMods\Maxsi Distribution
set MDBuild=Sortie


set FileName=%1%
CALL SET FileName=%%FileName:~1,-1%%
set InputDir=%2%
CALL SET InputDir=%%InputDir:~1,-1%%
set OutputDir=%3%
CALL SET OutputDir=%%OutputDir:~1,-1%%
set SolutionDir=%4%
CALL SET SolutionDir=%%SolutionDir:~1,-1%%

if not exist "%MDRoot%" mkdir "%MDRoot%"
if not exist "%MDRoot%\%MDBuild%" mkdir "%MDRoot%\%MDBuild%"
if not exist "%MDRoot%\%MDBuild%\%OutputDir%" mkdir "%MDRoot%\%MDBuild%\%OutputDir%"

echo Updating: Maxsi Distribution\%MDBuild%\%OutputDir%\%FileName%

@if exist "%SolutionDir%\%InputDir%\%FileName%" copy "%SolutionDir%\%InputDir%\%FileName%" "%MDRoot%\%MDBuild%\%OutputDir%\%FileName%"